package opp;

public class ArrayCopy {
    public static void main(String[] args) {
        //与引用传递不同的值复制
        int[] arr1={10,20,30};
        int[] arr2=new int [arr1.length];
        for(int i=0;i<arr1.length;i++)
        {
            arr2[i]=arr1[i];
        }
        //更换arr2中的一个值
        arr2[0]=100;
        System.out.println("==arr1==");
        for(int i=0;i<arr1.length;i++)
        {
            System.out.print(+arr1[i]+" ");
        }
        System.out.println("\n==arr2==");
        for(int i=0;i<arr2.length;i++)
        {
            System.out.print( +arr2[i]+" ");
        }

    }
}
